﻿//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Common
//  File name:	MetaForms.cs
//  Developer:	Solomatov Igor
//  Created:	15.04.2012
// 
//  -------------------- iSharePoint -------------------- //

using System.Collections.Generic;

namespace Smart.Common.Forms
{
	/// <summary>
	/// Forms definition
	/// </summary>
	public class MetaForms : MetaFormCtrl
	{
		/// <summary>
		/// Forms collection
		/// </summary>
		public List<MetaForm> Forms { get; set; }

		/// <summary>
		/// Form chooser rules
		/// </summary>
		public MetaFormsRules Rules { get; set; }

		/// <summary>
		/// Forms definition
		/// </summary>
		public MetaForms()
			: base(null, null)
		{
			Forms = new List<MetaForm>();
			Rules = new MetaFormsRules();
		}

		/// <summary>
		/// Set all child item parent property
		/// </summary>
		public virtual void SetParent()
		{
			foreach (var form in Forms)
				form.Parent = this;

			foreach (var rule in Rules)
				rule.Parent = this;
		}
	}
}